package com.itfreer.gis.server.vector.generate.pipeline;

import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryCollection;

import com.itfreer.gis.server.vector.generate.Pipeline;

public class CollapseCollections extends Pipeline {
	@Override
	protected Geometry _run(Geometry geom) throws Exception {
		if (geom instanceof GeometryCollection && geom.getNumGeometries() == 1) {
			return geom.getGeometryN(0);
		}
		return geom;
	}
}
